package com.hgh.javase3_1;

import java.math.BigDecimal;

import org.junit.Test;

public class DoubleTest1 {

	@Test
	public void testdouble(){
		double i = 2.0;
		double j = 1.9;
		System.out.println(i-j);//0.10000000000000009
		System.out.println(i+j);//3.9
		
		BigDecimal bigDecimal1 = new BigDecimal("2.0");
		BigDecimal bigDecimal2 = new BigDecimal("1.9");
		System.out.println(bigDecimal1.subtract(bigDecimal2));//0.1
		BigDecimal bigDecimal3 = new BigDecimal(2.0);
		BigDecimal bigDecimal4 = new BigDecimal(1.9);
		System.out.println(bigDecimal3.subtract(bigDecimal4));
		//0.100000000000000088817841970012523233890533447265625
	}
}
